from pkg.voice import out
import random
from pkg.db import db


def get_flirt_type():
    content,result= db.select_exec('SELECT * FROM 调情')
    if not result:
        out.output('数据库查询失败')
        return
    data=content.split('\n')
    data = [data[i] for i in range(len(data)) if not len(data[i]) == 0]
    r=random.randint(0,len(data)-1)
    data=data[r]
    data=data[1:][:-1]
    data=data.split(',')
    out.output('本次选择的调情项目为：')
    out.output(data[0])
    out.output('方向为')
    if int(data[1])==0:
        out.output('茂斌为芳芳做')
    else:
        out.output('芳芳为茂斌做')